home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr49 / 273_01.zip / GETXA.CC < prev    next >
Text File  |  1993-04-04  |  519b  |  19 lines

  1. #include <dos.h>
  2. get_xa()
  3. /* Read a keystroke.
  4.    An int will be returned as follows:
  5.       return value will be ascii code of key pressed or
  6.              value will be scan code of key press + 256 if the key press
  7.              was an extended key.  i.e. function key etc.
  8.  
  9.   The definitions of the extended keys are in the TCUTIL.H file.
  10. */
  11. {
  12.         int ret;
  13.         union REGS inregs, outregs;
  14.         inregs.h.ah=0;
  15.         int86(0x16,&inregs,&outregs);
  16.         if(outregs.h.al == 0x00) return(outregs.h.ah + 256);
  17.         return(outregs.h.al);
  18. }
  19.